package cn.itcast.mq.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description LazyConfig
 * @Author junjie Wu 吴俊杰
 * @Date 2024-03-24
 */
@Configuration
public class LazyConfig {
    /**
     * 惰性队列
     * @return
     */
    @Bean
    public Queue lazyQueue(){
        return QueueBuilder.durable("lazy.queue")
                .lazy()
                .build();
    }

    /**
     * 普通队列
     * @return
     */
    @Bean
    public Queue normalQueue() {
        return QueueBuilder.durable("normal.queue").build();
    }
}
